﻿@model Aga.GestionDeArchivos.Web.Models.EtiquetasCliente.ImprimirModel
@{
    Layout = null;
}
<!DOCTYPE html>
<html>
<head>
    <title>Imprimir</title>
    <link href="@Url.Content("~/Content/print.css")" rel="stylesheet" type="text/css" />
    <script src="@Url.Content("~/Scripts/jquery-1.4.4.min.js")" type="text/javascript"></script>
    <script src="@Url.Content("~/Scripts/jquery-barcode-2.0.1.js")" type="text/javascript"></script>
    <script type="text/javascript">
        $(document).ready(function () {

            var settings = {
              output:'css',
              bgColor: '#FFFFFF',
              color: '#000000',
              barWidth: 2,
              barHeight: 75,
              moduleSize: 5,
              showHRI: true,
              addQuietZone: false
            };

            @foreach (var c in Model.Cajas)
            {
                @:$("@(String.Format("#barcode_{0}", c.Id))").barcode("@(c.CodigoBarra.Replace("*", ""))", "code39", settings);     
            }
        });
    </script>
</head>
<body>
    <div class="tagContainer">
                    @for (int i = 1; i <= Model.Cajas.Count; i++)
                    {
                        <div class="tag">
                            <table border="1" cellpadding="0" cellspacing="0" style="border: 2px solid #000"
                                width="100%">
                                <tr>
                                    <td>
                                        Cliente N&deg;
                                    </td>
                                    <td>
                                        Caja N&deg;
                                    </td>
                                </tr>
                                <tr>
                                    <td>@Model.Cliente.Id
                                    </td>
                                    <td>@Model.Cajas[i-1].Numero
                                    </td>
                                </tr>
                                <tr>
                                    <td colspan="2">
                                        <center>
                                            <div id="@(String.Format("barcode_{0}", Model.Cajas[i - 1].Id))">
                                            </div>
                                        </center>
                                    </td>
                                </tr>
                            </table>
                        </div>
                        if (i % 14 == 0)
                        {
                            @:</div><div class="tagContainer">
                        }
                    }
    </div>
</body>
</html>
